﻿<div class="content-wrap">
    <div class="subnav_0">
        <ul class="greyTabs level_0">
            <li class="active">
                <a href="" class="ng-binding">Portfolio Management</a>
            </li>
            <li class="disabled">
                <a href="" class="ng-binding">Portfolio Analytics</a>
            </li>
            <li class="disabled">
                <a href="" class="ng-binding">Portfolio Monitoring</a>
            </li>
            <div class="clear"></div>
        </ul>
    </div>
    <div class="subnav_1">
        <ul class="greyTabs level_1">
            <li ng-class="portfolioList.sharedSelected ? '' : 'active'">
                <a href="" ng-click="portfolioList.selectMyPortfolio(); portfolioList.sharedSelected = false;">My Portfolio</a>
            </li>
            <li ng-class="portfolioList.sharedSelected ? 'active' : ''">
                <a href="" ng-click="portfolioList.selectSharedPortfolio(); portfolioList.sharedSelected = true;">Shared Portfolio</a>
            </li>
            <div class="clear"></div>
        </ul>
    </div>
    <div class="content">
        <div class="content-pad">            
            <!--<div class="left-content">
                
            </div>

            <div class="right-content">
                
                
            </div>-->
            <div class="title-section">
                <input type="button" value="Add Portfolio" ng-disabled="!portfolioList.hasPortfolioPermision" class="btn-green" style="float: right; margin-top: 0;" ng-click="portfolioList.openAddPortfolioPopup()">
            </div>
            
            <div class="clear">&nbsp;</div><br />           
            <div class="">             

                <div style="width: 100%; overflow: auto;">
                    <div class="table">
                        <div class="table-row">
                            <div class="table-head width_370"><a href="" class="sortable_placeholder" ng-click="portfolioList.setOrderByCol('NameLowercase');" ng-class="portfolioList.orderByCol === 'NameLowercase' ? (portfolioList.orderByAsc ? 'sortable_up' : 'sortable_down') : null">Portfolio Name</a></div>
                            <div class="table-head center-align width_130">No. of securities</div>
                            <!--<div class="table-head center-align width_130">Alerts</div>-->
                            <div class="table-head center-align width_130">Sharing</div>
                            <div class="table-head center-align width_130">Created by</div>
                            <div class="table-head center-align width_130">Last edited</div>
                            <div class="table-head center-align width_200">Actions</div>
                        </div>
                        <div ng-repeat="item in portfolioList.portfolioList" class="{{$index % 2==1 ? 'table-row odd': 'table-row'}}">
                            <div class="table-cell width_370" ng-class="{'last':$last}" style="border-left: 1px solid #e0e0e0;"><a style="word-break: break-all;" href="#portfolios/{{item.id}}">{{item.name}}</a></div>
                            <div class="table-cell center-align" ng-class="{'last':$last}">{{item.companyCount}}</div>
                            <!--<div class="table-cell center-align">
                                <a href="#" class="disabled">Enabled</a>                                
                            </div>-->
                            <div class="table-cell center-align" ng-disabled="!$parent.portfolioList.portfolioFilter.sharingStatus" ng-class="{'last':$last}">
                                <div style="display: inline-block;">
                                    <div ng-init="true" ng-switch on="item.sharingStatus == 1 ? true : false">
                                        <button ng-switch-when='true' ng-disabled="!item.isMyPortfolio" ng-click='portfolioList.setShared(item)' class="switch-btn">Off</button>
                                        <button ng-switch-when='false' ng-disabled="!item.isMyPortfolio" ng-click='portfolioList.setPrivate(item)' class="switch-btn_on">On</button>
                                    </div>
                                </div>
                            </div>
                            <div class="table-cell center-align" ng-class="{'last':$last}">{{item.addedByFullName}}</div>
                            <div class="table-cell center-align" ng-class="{'last':$last}">{{item.dateModified | date: 'MMM d, y'}}</div>
                            <div class="table-cell center-align width_200" ng-class="{'last':$last}">
                                <div style="margin: 5px auto 0 auto; width: 66px;">
                                    <!--<a href="#" style="color:lightgray; pointer-events: none; cursor: default;margin-right: 10px; float: left;">Edit</a>-->
                                    <a href="" ng-click="portfolioList.addTaskExportPortfolio(item)" style="margin-right: 10px; float: left;">Export</a>
                                    <button style="float: left;" class="delete-sel-large" ng-disabled="!item.isMyPortfolio" ng-click="portfolioList.deletePortfolio(item.id)"></button>
                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <!--<sustainalytics-pager></sustainalytics-pager>-->
                </div>

                <sustainalytics-pager></sustainalytics-pager>
            </div>
        </div>
    </div>
</div>